<%-- 
    Document   : index
    Created on : Jul 12, 2013, 3:16:05 PM
    Author     : Logic
--%>

<%@page import="info.toegepaste.www.beans.Alumnus"%>
<%@page import="info.toegepaste.www.beans.Account"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Project Alumni</title>
        <link rel="stylesheet" type="text/css" href="style.css"/>
    </head>
    <body>
        <%Account login = (Account) session.getAttribute("login");
            Alumnus alumnus = (Alumnus) session.getAttribute("alumnus");

        %>

        <h1>Alumni</h1>
        <br/>
        <label><%if (login != null) {%>

            <p>Welkom <%
                if (login.getType().equals("a")) {%>
                <%=alumnus.getVoornaam()%> <%=alumnus.getAchternaam()%>
                <%} else if (login.getType().equals("m")) {%>
                Administrator
                <%}%>

                , Type: <%=login.getType()%></p>

            <%}%></label>
        <br/>
        <form action="RegistratieServlet" method="post">
            <input type="submit" value="Registreren" id="registereren" name="registratieButton"/>
        </form>
        <form action="RegistratieServlet" method="post">
            <input type="submit" value="Events" id="eventButton" name="eventButton"/>
        </form>

        <%if (login
                    == null) {%>
        <form action ="LoginServlet" method="post">

            <label for="username">Gebruikersnaam: </label>
            <input type="text" id="username" name="username"/>
            <label for="password">Wachtwoord: </label>
            <input type="password" id="password" name="password"/>
            <input type="submit" value="Inloggen" id="loginbutton" name="loginbutton"/><br/>
            <%}%>
            <%if (login
                        != null) {%>
                        <%if (login.getType().equals("m")) {%>
                        <%} else {%>
            <form action="LoginServlet" method="post">
                 <input type="submit" value="Profiel" id="profiel" name="profiel"/>
            </form>
                <%}%>
                
               
            <form action="RegistratieServlet" method="POST">
                <input class="knop" type="submit" value="Uitloggen" name="logoutButton"/>
            </form>
                <%if (login.getType().equals("m")) {%>
                <form action="ZoekServlet" method="post">
                    <input type="submit" value="Zoek alumni" id="adminzoekButton" name="adminzoekButton"/>
                </form>
                <form action="AdminServlet" method="post">
                    <input type="submit" value="Statistieken" id="statistiekButton" name="statistiekButton"/>
                </form>
                <%}%>
            <%}%>

        </form>
    </body>
</html>
